-
Notifications
You must be signed in to change notification settings - Fork 3.3k
chore: add watcher for cy-prompt development #31810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add watcher for cy-prompt development #31810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for a live-reload watcher in the CyPrompt flow when developing against a local cy-prompt path.
- Refactors
ensureCyPromptBundle
to always compute its ownbundlePath
and remove the old local-copy branch - Introduces a
chokidar
watcher inCyPromptLifecycleManager
guarded byCYPRESS_LOCAL_CY_PROMPT_PATH
- Updates unit tests to cover both remote bundle and local watcher scenarios
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/server/test/unit/cloud/cy-prompt/ensure_cy_prompt_bundle_spec.ts | Removed local‐path stubs/tests; adjusted copy/readFile stubs |
packages/server/test/unit/cloud/cy-prompt/CyPromptLifecycleManager_spec.ts | Added tests for watcher setup and listener behavior in local mode |
packages/server/lib/cloud/cy-prompt/ensure_cy_prompt_bundle.ts | Dropped local-copy logic; derive bundlePath via path.join |
packages/server/lib/cloud/cy-prompt/CyPromptLifecycleManager.ts | Added hashLoadingMap , integrated chokidar watcher, extracted cloud metadata |
packages/server/lib/cloud/StudioLifecycleManager.ts (deleted) | Removed outdated Studio lifecycle manager |
Comments suppressed due to low confidence (3)
packages/server/lib/cloud/cy-prompt/CyPromptLifecycleManager.ts:19
- [nitpick] The name
hashLoadingMap
is ambiguous; consider renaming it tohashLoadingPromises
orloadingPromiseByHash
for clearer intent.
private static hashLoadingMap: Map<string, Promise<void>> = new Map()
packages/server/test/unit/cloud/cy-prompt/CyPromptLifecycleManager_spec.ts:100
- Consider adding a test that calls
initializeCyPromptManager
multiple times with the same cyPromptHash to verify thatensureCyPromptBundle
is only invoked once and that subsequent calls reuse the cached promise.
// Add tests for cached bundle loading behavior
packages/server/lib/cloud/cy-prompt/ensure_cy_prompt_bundle.ts:14
- The code uses
path.join
but thepath
module is not imported. Addimport path from 'path'
at the top of the file to avoid a ReferenceError.
const bundlePath = path.join(cyPromptPath, 'bundle.tar')
cypress
|
Project |
cypress
|
Branch Review |
ryanm/chore/add-watch-for-cy-prompt
|
Run status |
|
Run duration | 18m 23s |
Commit |
|
Committer | Ryan Manuel |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
8
|
|
1232
|
|
0
|
|
32187
|
View all changes introduced in this branch ↗︎ |
UI Coverage
46.11%
|
|
---|---|
|
189
|
|
166
|
Accessibility
92.73%
|
|
---|---|
|
3 critical
9 serious
2 moderate
2 minor
|
|
698
|
Additional details
Add watcher for cy-prompt development that is enabled when
process.env.CYPRESS_LOCAL_CY_PROMPT_PATH
is set. This goes along with this PR.Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?